import 'package:flutter/cupertino.dart';
import 'package:flutter_deer/indent/iview/indent_search_list_iview.dart';
import 'package:flutter_deer/index/models/user_betting_entity.dart';
import 'package:flutter_deer/mvp/base_page_presenter.dart';
import 'package:flutter_deer/net/base_entity.dart';
import 'package:flutter_deer/net/net.dart';
import 'package:flutter_deer/util/other_utils.dart';

class IndentSearchListPresenter extends BasePagePresenter<IndentSearchListIMvpView> {

  @override
  void initState() {
  }

  Future<dynamic> search(String? name) async{
    WidgetsBinding.instance.addPostFrameCallback((_) {
      asyncRequestNetwork<BaseEntity<UserBettingSearchEntity>>(Method.get,
        url: HttpApi.footballIndentSearchList.replaceAll("{name}", name.nullSafe),
        onSuccess: (data) {
          view.setSearchResult(data!.data);
        },
        onError: (code,msg){

        }
      );
    });
  }


}